[XEND] Another attempt at fixing escaping logic in SXP
authorAlastair Tse <atse@xensource.com>
Thu, 5 Oct 2006 19:02:50 +0000 (20:02 +0100)
committerAlastair Tse <atse@xensource.com>
Thu, 5 Oct 2006 19:02:50 +0000 (20:02 +0100)
Signed-off-by: Alastair Tse <atse@xensource.com>
tools/python/xen/xend/sxp.py

index af7cb9c0c2a7e16649e3d666d8392dd28770f905..a9e9adf17feaeddbf4fef0e3601f5ee7a4ff53ff 100644 (file)
@@ -267,12 +267,13 @@ class Parser:
         elif c == 'x':
             self.state.fn = self.state_hex
             self.state.val = 0
-        elif c == '0':
+        elif c in string.octdigits:
             self.state.fn = self.state_octal
             self.state.val = 0
             self.input_char(c)
         else:
             # ignore escape if it doesn't match anything we know
+            self.state.parent.buf += '\\'
             self.pop_state()
 
     def state_octal(self, c):